//
//  ApplyInIdentfierCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/8/29.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "ApplyInIdentfierCell.h"

@implementation ApplyInIdentfierCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Medium" size:15];
        self.titleLabel.font = [UIFont systemFontOfSize:15];
        self.titleLabel.textColor = COLOR_HEX(0x121212);
        [self.contentView addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(20));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(120), scaleTopAndBottom(20)));
            //            self.titleLabel.backgroundColor = [UIColor cyanColor];
        }];
        self.backImageView = [[UIImageView alloc] init];
        self.backImageView.userInteractionEnabled = YES;
        [self.contentView addSubview:self.backImageView];
        [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-45));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(10));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(93.5), scaleTopAndBottom(55)));
        }];
        self.frontImageView = [[UIImageView alloc] init];
        self.frontImageView.userInteractionEnabled = YES;
        [self.contentView addSubview:self.frontImageView];
        [self.frontImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.backImageView.mas_left).offset(scaleLeftAndRight(-17));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(10));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(93.5), scaleTopAndBottom(55)));
        }];
        UILabel *backLabel = [[UILabel alloc] init];
        backLabel.font = [UIFont systemFontOfSize:15];
        backLabel.textColor = COLOR_HEX(0x121212);
        [self.contentView addSubview:backLabel];
        backLabel.text = @"反面";
        backLabel.textAlignment = NSTextAlignmentCenter;
        [backLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-45));
            make.centerX.mas_equalTo(self.backImageView.mas_centerX); make.top.equalTo(self.backImageView.mas_bottom).offset(scaleTopAndBottom(10));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(90), scaleTopAndBottom(10)));
        }];
        UILabel *frontLabel = [[UILabel alloc] init];
        frontLabel.font = [UIFont systemFontOfSize:15];
        frontLabel.textColor = COLOR_HEX(0x121212);
        [self.contentView addSubview:frontLabel];
        frontLabel.text = @"正面";
        frontLabel.textAlignment = NSTextAlignmentCenter;
        [frontLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self.frontImageView.mas_centerX);
            make.top.equalTo(self.frontImageView.mas_bottom).offset(scaleTopAndBottom(10));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(93.5), scaleTopAndBottom(10)));
        }];
        self.backImageView.image = [UIImage imageNamed:@"小"];
        self.frontImageView.image = [UIImage imageNamed:@"小"];
    }
    return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
